import 'package:flutter/material.dart';
import 'package:lai_zhan/common/style/AppStyle.dart';

class FlexableIconButton extends StatelessWidget {

  double height;
  int flex;
  Color backgroundColor;
  Color fontColor;
  Color iconColor;
  double iconSize;
  double fontSize;
  IconData iconData;
  String text;
  VoidCallback onClick;


  FlexableIconButton({this.height, this.flex, this.backgroundColor,
    this.fontColor, this.iconColor, this.iconSize, this.fontSize,
    this.iconData, this.text ,this.onClick});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Flexible(
        flex: flex,
        child: new GestureDetector(
          child: new Container(
            color: backgroundColor,
            height: height,
            child: new Center(
              child: new Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new Icon(iconData,size: iconSize,color: iconColor,),
                  new Padding(padding: EdgeInsets.all(2)),
                  new Text(text,style: TextStyle(fontSize: fontSize,color: fontColor),)
                ],
              ),
            ),
          ),
          onTap: onClick,
        ));
  }
}